﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Tencent.OA.ACM.Entity.ReportModel>" %>

<%@ Import Namespace="Tencent.OA.ACM.Entity" %>
<%@ Import Namespace="Tencent.OA.ACM.App" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeaderPlaceHolder" runat="server">
     <link href="<%= this.Url.Content("~/Content/jquery.fmext.css") %>" rel="stylesheet"
        type="text/css" />

    <script type="text/javascript" language="javascript" src="<%=this.Url.Content("~/content/staffChooser.js") %>"></script>

    <script type="text/javascript" language="javascript" src="<%=this.Url.Content("~/content/Scripts/jquery.fmext.js") %>"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContainerPlaceHolder" runat="server">
    <div class="title ">
        班车路线站点统计
    </div>
    <!--查询条件 Start-->
    <ul id="tags" class="tags">
        <li><a href='<%=this.Url.Content("~/Report/Index") %>'>班车统计报表</a></li>
        <li class="selectTag"><a href="#">班车路线站点统计</a></li>
    </ul>
    <div class="tagCon">
        <div id="tagContent2" class="tagContent ">
        </div>
    </div>
    <div id="condition">
        <%=Html.Hidden("condition_hidden","YES") %>
        <% 
            IList<RouteInfo> allRoute = ViewData["allRoute"] as IList<RouteInfo>;
        %>
        <table cellpadding="0" cellspacing="10">
            <tr>
                <th>
                    路线名：
                </th>
                <td>
                    <select id="routeName">
                        <%
                            foreach (RouteInfo ri in allRoute)
                            {
                        %>
                        <option value="<%=ri.RouteId%>">
                            <%=ri.RouteName%></option>
                        <%
                            }
                        %>
                    </select>
                </td>
                <th>
                    时间范围：
                </th>
                <td>
                    <%=Html.TextBox("BeginDate",DateTime.Today.AddMonths(-1).ToShortDateString(), new { @class = "form_text dateinput", style = "width:93px;" })%>
                    ~
                    <%=Html.TextBox("EndDate", DateTime.Today.ToShortDateString(), new { @class = "form_text dateinput", style = "width:93px;" })%>
                </td>
                <th colspan="2" style="width: 30%">
                    &nbsp;
                </th>
            </tr>
            <tr>
                <th>
                </th>
                <td>
                    <input type="button" class="form_bot" onclick="onExport();" name="submit" value="导出Excel"
                        style="width: 100px;" />
                </td>
                <td colspan="4">
                </td>
            </tr>
        </table>
    </div>
    <div style="display: none;">
        <iframe id="ifExportExcel" src="<%=this.Url.Content("~/Report/ExcelPost")%>"></iframe>
    </div>
    <script language="javascript">
        var dircache = '<%=this.Url.Content("~/caches/") %>';
        var all_rs = [];

        $(document).ready(function() {

        });
        function onExport() {
            if ($("#BeginDate").val().length == 0 || $("#EndDate").val().length == 0) {
                InfoTip.showMessage("开始时间或结束时间不能为空！", "2");
                return false;
            }
            if (compareDate($("#BeginDate").val(), $("#EndDate").val())) {
                InfoTip.showMessage("开始时间不能晚于结束时间！", "2");
                return false;
            }
            exportExcel();
        }

        //导出Excel
        function exportExcel() {
            window.frames[0].document.getElementById("excelType").value = "3";
            var param = $("#routeName option:selected").val()
                            + '|'
                            + $("#BeginDate").val()
                            + '|'
                            + $("#EndDate").val();
            window.frames[0].document.getElementById("searchCondition").value = param;
            window.frames[0].document.forms[0].submit();
        }
    </script>
</asp:Content>
